//
//  XML_Bloomberg_Quote.h
//  MacStockApp
//
//  Created by 英傑 翁 on 12/2/27.
//  Copyright (c) 2012年 翁英傑. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "Data_Model.h"


@interface XML_Bloomberg_Quote : NSOperation <NSXMLParserDelegate> {
    
    
    
    NSMutableArray  *bloomberg_data_quote_array;     
    NSMutableDictionary *bloomberg_node;
    NSString *node_name;
    NSString *node_value;

    NSURL *targetURL;     
   
    id delgeate;
     
}
 
@property(retain) id delgeate;


-(id)init_WithURL:(NSURL*)url; 
 
@end



/*
 get_search_array_data 傳回的陣列的元素為Dictionary 
 其中key 分別如下：
 
 symbol:代碼
 name:名稱
 exchDisp:國家        
 class:證券種類  
 typeDisp:產業分類    
 
 */



// NSString *urls_bloomberg=[NSString stringWithFormat: @"http://m.bloomberg.com/iphone/apps/wds/SecurityData.asp?Securities=%@%%3A%@&Outfields=WBTKR,DS192,DS520,PR005,PR051,PR052,PR006,PR007,PR008,PR013,DS318,HS001,HS003,HS002,HS004,UTIME,RT012,RR900,RR902&bbipver=1.0.9,%@,iPad,iPhone%%20OS,5.0.1,zh_TW,zh-Hant",symbol,country,identify] ; 
//NSString *urls_bloomberg=[NSString stringWithFormat: @"http://m.bloomberg.com/iphone/apps/wds/SecurityData.asp?Securities=%@%%3A%@&Outfields=WBTKR,DS192&bbipver=1.0.9,%@,iPad,iPhone%%20OS,5.0.1,zh_TW,zh-Hant",symbol,country,identify] ;    

//1.INTRADAY
//NSString *urls_bloomberg=@"http://m.bloomberg.com/iphone/apps/data.asp?pid=webpxta&Securities=AAPL%3AUS&Outfields=ITIME,PR005-I&bbipver=1.0.9,17243a4e72c7eadd0e9823cd887f97212efa43fa,iPad,iPhone%20OS,5.0.1,zh_TW,zh-Hant";    

//2.多檔股票報價
// NSString *urls_bloomberg=@"http://m.bloomberg.com/iphone/apps/wds/SecurityData.asp?Securities=AAPL%3AUS,IBM%3AUS,,2330%3ATT&Outfields=WBTKR,DS192,DS520,PR005,PR051,PR052,PR006,PR007,PR008,PR013,DS318,HS001,HS003,HS002,HS004,UTIME,RT012,RR900,RR902&bbipver=1.0.9,17243a4e72c7eadd0e9823cd887f97212efa43fa,iPad,iPhone%20OS,5.0.1,zh_TW,zh-Hant";     

//3.HISTORY
//NSString *urls_bloomberg=@"http://m.bloomberg.com/iphone/apps/data.asp?pid=webpxta&Securities=2330%3ATT&TimePeriod=5Y&Outfields=HDATE,PR005-H,PR006-H,PR007-H,PR008-H,PR013-H&bbipver=1.0.9,17243a4e72c7eadd0e9823cd887f97212efa43fa,iPad,iPhone%20OS,5.0.1,zh_TW,zh-Hant";    

//特別注意 在bloomberg網址中有一段 'iPad,iPhone%20OS,5.0.1,zh_TW,zh-Hant' 因為其中有一個%，因為是使用stringWithFormat
//所以必須要變成‘a43fa,iPad,iPhone%%20OS,5.0.’ 在此處要兩個 ％％

/*多檔股票報價
 //報價所要用的代碼
 
 
 //WBTKR:代碼
 //px:UTIME:時間  
 //PR005:收盤價    
 //PR006:開盤價
 //PR007:最高價
 //PR008:最低價
 //PR051:漲跌
 //PR052:漲跌福
 //PR013:成交量
 //DS318:簡介
 //DS520:全名
 //DS192:簡名
 //RR900:PE    
 //px:RR902:市值
 
 
 NSString *urls_bloomberg=@"http://m.bloomberg.com/iphone/apps/wds/SecurityData.asp?Securities=AAPL%3AUS,IBM%3AUS,,2330%3ATT&Outfields=WBTKR,DS192,DS520,PR005,PR051,PR052,PR006,PR007,PR008,PR013,DS318,HS001,HS003,HS002,HS004,UTIME,RT012,RR900,RR902&bbipver=1.0.9,17243a4e72c7eadd0e9823cd887f97212efa43fa,iPad,iPhone%20OS,5.0.1,zh_TW,zh-Hant";         
 
 */



/* 下載歷史資料
 //歷史資料所用的代碼
 //HDATE:日期
 //PR005-H:收盤價
 //PR006-H:開盤價
 //PR007-H:最高價
 //PR008-H:最低價
 //PR013-H:成交量    
 //HISTORY
 NSString *urls_bloomberg=@"http://m.bloomberg.com/iphone/apps/data.asp?pid=webpxta&Securities=2498%3ATT&TimePeriod=5Y&Outfields=HDATE,PR005-H,PR006-H,PR007-H,PR008-H,PR013-H&bbipver=1.0.9,17243a4e72c7eadd0e9823cd887f97212efa43fa,iPad,iPhone%20OS,5.0.1,zh_TW,zh-Hant";        
 */


 